//
//  ViewController.m
//  MWSDKDemo
//
//  Created by 刘家飞 on 15/5/28.
//  Copyright (c) 2015年 cafei. All rights reserved.
//

#import "ViewController.h"
#import "MWApi.h"
#import "Define.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [MWApi setLogEnable:NO];
}

#pragma mark UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
    NSString *string;
    switch (indexPath.row) {
        case 0:
        {
            string = @"通用活动样式";
            break;
        }
        case 1:
        {
            string = @"弹窗活动样式";
            break;
        }
        case 2:
        {
            string = @"自定义事件";
            break;
        }
        case 3:
        {
            string = @"退出登录";
            break;
        }
            
        default:
            break;
    }
    cell.textLabel.text = string;
    return cell;
}

#pragma mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
        {
            [self performSegueWithIdentifier:@"common" sender:nil];
            break;
        }
        case 1:
        {
            [self performSegueWithIdentifier:@"present" sender:nil];
            break;
        }
        case 2:
        {
            [self performSegueWithIdentifier:@"event" sender:nil];
            break;
        }
        case 3:
        {
            [MWApi cancelUserProfile];
        }
            
        default:
            break;
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
